<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = prompt()
        var reg = /\d/
        var reg1 = /\w/
        console.log(str.split(reg))  //按照正则表达式来将字符串划分成数组
        console.log(str.search(reg)) //按照正则规则返回第一个数的下标
        console.log(str.match(reg))  //把匹配的结果放到数组中返回
    </script>
</body>
</html>